#include <stdio.h>

int main(void)
{
	float km = 0.0;
	int time = 0;
	scanf_s("%f %d", &km, &time);

	int timepay = time / 5 * 2;
	float kmpay = 0;

	if (km <= 3) {
		kmpay += 10;
		//printf("in one if kmpay = %f\n", kmpay);
	}
	else if (km <= 10) {
		kmpay += 10;
		kmpay += (km - 3) * 2;
		//printf("in two if kmpay = %f\n", kmpay);
	}
	else {
		kmpay += 10;
		kmpay += 7 * 2;
		kmpay += (km - 10) * 3;
		//printf("in three if kmpay = %f\n", kmpay);
	}
	float add = kmpay + timepay;
	//printf("kmpay + timepay = %f\n", kmpay + timepay);

	int sishewuru = (int)(add * 10) % 10; //pay*10/1后%10取个位 最终得到小数点第一位 后续实现四舍五入
	//printf("(int)(add * 10) %% 10 = %d\n", (int)(add * 10) % 10);

	int pay = (int)add;
	//printf("(int)add = %d\n", (int)add);

	if (sishewuru >= 5) {
		pay += 1;
	}

	//printf("pay = %d\n", pay);
	printf("%d", pay);

	return 0;
}